package com.eastfair.venuebooking.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.core.base.R;
import com.eastfair.venueservice.dto.BizStateDTO;
import com.eastfair.venueservice.dto.ServiceOrderDTO;
import com.eastfair.venueservice.entity.ServiceOrder;
import com.eastfair.venueservice.vo.ServiceOrderVO;
import feign.Request;
import jdk.nashorn.internal.ir.RuntimeNode;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 服务订单 Feign.
 *
 * @author dqq
 * @date 2022 /10/9
 */
@FeignClient("venue-services-manage/serviceOrder")
public interface ServiceOrderFeign {

    /**
     * 分页查询服务订单列表.
     *
     * @param pageParams the page params
     * @return the r
     */
    @PostMapping("/query/serviceOrder")
    R<Page<ServiceOrderVO>> queryServiceOrders(@RequestBody PageParams<ServiceOrderDTO> pageParams);

    /**
     * 订单编号获取服务订单VO.
     *
     * @param orderNumber the order number
     * @return the by id
     */
    @GetMapping("/get/{orderNumber}")
    R<ServiceOrderVO> getById(@PathVariable("orderNumber") String orderNumber);

    /**
     * 保存订单.
     *
     * @param serviceOrderDTO the service order dto
     * @return the r
     */
    @PostMapping("/save")
    R<ServiceOrder> saveServiceOrder(@RequestBody ServiceOrderDTO serviceOrderDTO);

    /**
     * 修改服务订单.
     *
     * @param serviceOrderDTO the service order dto
     * @return the r
     */
    @PostMapping("/update")
    R<ServiceOrder> updateServiceOrder(@RequestBody ServiceOrderDTO serviceOrderDTO);

    /**
     * 提交订单.
     *
     * @param orderNumber the order number
     * @return the r
     */
    @GetMapping("/submit/{orderNumber}")
    R<Boolean> submit(@PathVariable("orderNumber") String orderNumber);

    /**
     * 取消订单.
     *
     * @param orderNumber the order number
     * @return the r
     */
    @GetMapping("/cancel/{orderNumber}")
    R<Boolean> cancel(@PathVariable("orderNumber") String orderNumber);

    /**
     * 更新退款状态
     *
     * @param serviceOrderDTO the service order dto
     * @return the r
     */
    @PostMapping("/update/refundStatus")
    R<Boolean> updateRefundStatus(@RequestBody ServiceOrderDTO serviceOrderDTO, Request.Options options);

    /**
     * 更新开票状态
     *
     * @param serviceOrderDTO the service order dto
     * @return the r
     */
    @PostMapping("/update/invoiceStatus")
   R<Boolean> updateInvoiceStatus(@RequestBody ServiceOrderDTO serviceOrderDTO);

    /**
     * 更新订单退款状态.
     *
     * @param BizStateDTO
     * @return the r
     */
    @PostMapping("/updateBizRefundState")
    R<Boolean> updateBizRefundState(@RequestBody BizStateDTO BizStateDTO);

    /**
     * 更新订单开票状态.
     *
     * @param BizStateDTO
     * @return the r
     */
    @PostMapping("/updateBizInvoiceApplyState")
    R<Boolean> updateBizInvoiceApplyState(@RequestBody BizStateDTO BizStateDTO);
}